package com.woniuxy.his.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.woniuxy.his.entity.Prescription;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.his.vo.PayOfPrescriptionVo;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 处方表 Mapper 接口
 * </p>
 *
 * @author Lucas
 * @since 2021-08-25
 */
public interface PrescriptionMapper extends BaseMapper<Prescription> {

    @Select("SELECT hp.prescription_id,hc.patient_name from his_prescription hp,his_case hc where hp.ispaid = 'no' and hp.case_id=hc.case_id and hp.rwa_add_time BETWEEN #{startTime} and #{stopTime}")
    IPage<PayOfPrescriptionVo> getAllPrescriptionPayMassage(IPage<PayOfPrescriptionVo> page, Date startTime, Date stopTime);
}
